import request from '@/utils/request'
import { AxiosPromise } from 'axios'

enum Api {
  list = '/channelConfig/list',
  add = '/channelConfig/add',
  edit = '/channelConfig/edit',
}

// 获取通道列表
export const channelConfigList = (data): AxiosPromise<any> => {
  return request({
    url: Api.list,
    method: 'post',
    data,
  })
}

// 编辑、保存
export const channelConfigSave = (data: any) => {
  return request({
    url: data.id ? Api.edit : Api.add,
    method: 'post',
    data,
  })
}
